# # #########练习一#########
# company = {'BOSS': '唐僧', 'CTO': '悟空', 'CFO': '八戒', '搬砖': '沙僧', '苦力': '白龙马'}
# print(company['CTO'])
# print(company['BOSS'])
# print(company.items())
#
# for key, value in company.items():
#     print(key, "是", value)
#
# a = input("请输入需要判断的人物：")
# if a in company.values():
#     print(f"{a}在company中")
# else:
#     print(f"{a}不在company中")

# #######练习二##########
print("####欢迎使用用户检测系统####")
user_table = {'root': '123456', 'admin': 'admin'}
while True:
    username = input("请输入你的用户名：")
    if username == 'quit':
        break
    elif username in user_table.keys():
        passwd = input("请输入密码：")
        if passwd == user_table.get(user_table):
            print("登录成功")
        else:
            print("登陆失败，请重新登录！")

            break

